#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;

int read() {
    int x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e6 + 10;
int n;
int ans[N], x[N], ls;
char s[N];

void sub(int t) {
	x[t]--; rep(i, t, ls) if(x[i] < 0) x[i] += 2, x[i + 1]--; else break;
	while(ls > 0 && x[ls] == 0) ls--;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
    n = in; scanf("%s", s + 1); ls = strlen(s + 1); //reverse(s + 1, s + ls + 1);
	rep(i, 1, ls) x[i] = s[ls - i + 1] - '0'; 
	putchar('1'); sub(1); //x[1]++; rep(i, 1, ls) if(x[i] >= 2) x[i] -= 2, x[i + 1]++; if(x[ls + 1]) ls++;
	rep(i, 2, n) {
		sub(1);
		bool fl = 0; //cerr << i << " ";
		if(ls > n - i + 1) fl = true;
		else if(ls == n - i + 1) {
			per(j, ls - 1, 1) if(x[j]) { fl = true; break; } 
		}
		if(fl) {
			putchar('1'); sub(n - i + 1); sub(1);
		} else {
			putchar('0');
		}
		//	rep(j, 1, ls) cerr << x[j] << " " ; cerr << endl;
		//while(ls > 0 && x[ls] == 0) ls--;
		if(ls == 0) break;
	}
}
